<div id="video">
<?php
if($temp==''){
	$meta_title .= 'Video yoga dành cho các bà Mẹ';
	$meta_des .= 'Yoga mang lại những lợi ích tuyệt vời cho bà mẹ trong thời gian mang thai, quá trình chuyển dạ và cả khả năng lấy lại vóc dáng sau sinh';
	$meta_key .= 'yoga dành cho các bà Mẹ, yoga cho bà bầu, yoha cho mẹ,';
	$view_video .= '<h1>Video yoga dành cho các bà Mẹ</h1>';
	$query = mysql_query('SELECT name,name_rewrite,url_hinh,description FROM articles WHERE `delete`=0 AND status=1 ORDER BY date_update');
	while($row_video = mysql_fetch_array($query)){
		$view_video .= '<div class="item_articles"><a href="11223344556688/articles_'.$row_video['name_rewrite'].'.html" title="'.$row_video['name'].'"><img src="'.url_hinh_articles_thumb.$row_video['url_hinh'].'" alt="'.$row_video['name'].'" /><h2>'.$row_video['name'].'</h2></a>
        <h4>'.$row_video['description'].'</h4></div>';
	}
}else{
	$query = mysql_query("SELECT id,name,url_hinh,description,date_create,content,metaKeyword FROM articles WHERE `delete`=0 AND status=1 AND name_rewrite='{$temp}'");
	$row_video = mysql_fetch_array($query);
	$meta_title .= $row_video['name'];
	$meta_des .= $row_video['description'];
	$meta_key .= $row_video['metaKeyword'].',';
	if(@$idUser) $video_user = '<img src="'.$avatar.'" class="avatar" alt="'.$idUser.'" /><input type="text" name="video_comment" value="Viết bình luận..." id="'.$row_video['id'].'" /><div style="clear:both; height:1px; border-bottom:solid 1px #FFF; padding-top:5px"></div><div id="ajax_video_cm"></div>';
	$view_video .= '<div id="navigator"><a href="11223344556688/articles.html" title="Yoga cho các bà mẹ">Yoga cho các bà mẹ</a></div><div id="view_post"><h1>'.$row_video['name'].'</h1><div class="date">'.date('d/m/Y H:i', strtotime($row_video['date_create'])).'</div><div id="content">'.$row_video['content'].'</div></div><div id="comment_video">'.$video_user;
	$query = mysql_query("SELECT comment,user_id,date_create FROM articles_comment WHERE articles_id='{$row_video['id']}' ORDER BY date_create DESC");
	while($row_video = mysql_fetch_array($query)){
		$user_video = $tc->user_info($row_video['user_id']);
		$user_video = mysql_fetch_array($user_video);
		$view_video .= '<div class="item"><a href="'.$user_video['id'].'/"><img src="'.url_hinh_user_40x40.$user_video['avatar'].'.jpg" alt="'.$user_video['name'].'" /></a><div class="content"><strong>'.$user_video['name'].'</strong> '.$row_video['comment'].' <div class="date">'.$tc->wall_datetime($row_video['date_create']).'</div></div></div>
		<div style="clear:both; height:1px; background-color:#FFF"></div>';
	}
	$view_video .= '</div>';
}
echo $view_video;
?>
    
</div>
<script type="text/javascript">
	$("input[name=video_comment]").focus(function(){
		var cm = $(this).val();
		if(cm=='Viết bình luận...') $(this).val('');
		$(this).keydown(function(e){
			var cm = $(this).val();
			var id = $(this).attr('id');
			var key = e.keyCode;
			id = $.trim(id);
			cm = $.trim(cm);
			if(key==13 && id!='' && cm!=''){
				$(this).attr('disabled',true);
				$.post("ajax.php",{video_comment:"video_comment",cm:cm,id:id},function(data){
					$("input[name=video_comment]").val('');
					if(data!='0'){
						$("#ajax_video_cm").prepend('<div class="item"><a href="<?php echo $idUser?>/"><img src="<?php echo $avatar?>" /></a><div class="content"><strong><?php echo $_SESSION['name']?></strong> '+ cm +'</div></div><div style="clear:both; height:1px; background-color:#FFF"></div>');
						setTimeout(function(){
							$("input[name=video_comment]").attr('disabled',false);
						},200);
					}
				});
			}
		});
	});
</script>